#!/sbin/openrc-run

name="greetd"
description="Greeter daemon"

: ${cfgfile:="/etc/greetd/config.toml"}

command=/usr/sbin/greetd
command_args="--config $cfgfile ${command_args:-}"
command_background=yes
pidfile="/run/$RC_SVCNAME.pid"

required_files="$cfgfile"

start_pre() {
	# note that this user is the user from the config.toml
	checkpath -d -m750 -o greetd:greetd /run/greetd/ 
}

depend() {
	need localmount
	provide display-manager
}
